var prefix = ctx + "app/warningreview"
$().ready(function() {
	//loadscoreId();
	//validateRule();
});

/*$.validator.setDefaults({
	submitHandler : function() {
	}
});*/
function doReview() {
	var reason = $("#reason").val();
	var state = $('input:radio[name="state"]:checked').val();
	var ok = true;
	if(state == 2){
		if(reason == null || reason == ""){
			alert("请输入审核不通过原因");
			ok = false;
		}
	}
	if(ok){
		$.ajax({
			cache : true,
			type : "POST",
			dataType: "json",
			url : prefix + "/approve",
			data : {
				"id" : $("#warningId").val(),
				"reason" : $("#reason").val(),
				"modelName" : $("#modelName").val(),
				"operator" : $("#operator").val(),
				"state" : state
			},
			async : false,
			error : function(request) {
				parent.layer.alert("网络超时");
			},
			success : function(data) {
				if (data.code == 0) {
					parent.layer.msg("操作成功");
					parent.reLoad();
					var index = parent.layer.getFrameIndex(window.name);
					parent.layer.close(index);

				} else {
					parent.layer.alert(data.msg)
				}

			}
		});
	}
}